﻿using System;
using System.Data;
using System.Linq;
using System.Web.UI.WebControls;
using ASPNETVN.PORTAL.Components.UI;
using System.Collections;
using System.Collections.Generic;
using System.Web.UI;
using System.Web;
using ASPNETVN.PORTAL.Components.Security;
using ASPNETVN.PORTAL.Components.Share;
using LMHTX.Modules.DIRECTORY.COOPERATIVE.Components;

namespace LMHTX.Modules.DIRECTORY.COOPERATIVE.Controls
{
    public partial class TrainingLevelManager : AddEditItemControl
    {
        protected override void OnInit(EventArgs e)
        {
            this.ButtonUpdate = btnAdd;
            this.ButtonCancel = btnCancel;

            this.Update += AreaManager_Update;
            base.OnInit(e);
        }

        void AreaManager_Update(object sender, EventArgs e)
        {
            TrainingLevel item = new TrainingLevel();
            item.Title = txtTitle.Text;
            item.Description = txtDescription.Text;
            item.ModuleID = this.ModuleID;
            item.Insert();

            gvArea.DataBind();
            this.ResetInputData();
        }      

        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

        private void ResetInputData()
        {
            txtTitle.Text = "";
            txtDescription.Text = "";
        }
    }
}